package com.muyi.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyi.pojo.entity.Category;
import com.muyi.service.CategoryService;
import com.muyi.mapper.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author VRMMO
* @description 针对表【category】的数据库操作Service实现
* @createDate 2025-06-11 15:04:41
*/
@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category>
        implements  CategoryService{
    
    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> list() {
        return categoryMapper.list();
    }

    @Override
    public void delete(Integer id) {
        categoryMapper.deleteById(id);
    }

    @Override
    public void add(Category category) {
        categoryMapper.insert(category);
    }

    @Override
    public void update(Category category) {

        categoryMapper.update(category);
    }

    @Override
    public Category getByCategoryId(Integer id) {
        return categoryMapper.getByCategoryId(id);
    }

}




